<template>
  <div class="content-block block-1" style="padding: 0;background: none;">
    <div class="flex justify-between overview">
      <div
        class="overview-item" v-for="(item, index) in info"
        :key="index" :style="{backgroundColor: themeColor}"
      >
      <span class="item-icon" v-if="item.icon">
        <svg-icon :name="item.icon"></svg-icon>
      </span>
        <h2 class="item-label">{{ item.label }}</h2>
        <div class="item-main">
          <span class="item-number">{{ item.count }}</span>
          <span class="item-unit">{{ item.unit }}</span>
        </div>
        <p class="item-content">
          {{ item.content }}
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'grid-item-one',
  props: {
    title: String,
    info: {
      type: Array,
      default () {
        return []
      }
    }
  },
  computed: {
    themeColor () {
      return this.$store.state.user.theme
    }
  }
}
</script>


<style lang="scss" scoped>
@import "@/assets/style/variable.scss";

.overview-item {
  flex: 1;
  border-radius: 4px;
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;

  & + .overview-item {
    margin-left: $gutter;
  }
}

.item-label {
  font-size: 18px;
  font-weight: 500;
  margin-top: 0;
}

.item-number {
  font-size: 20px;
  color: orange;
  margin-right: 5px;
}

.item-icon {
  position: absolute;
  right: 20px;
  bottom: 10px;
  font-size: 3vw;
  color: white;
  opacity: .8;
}
</style>
